<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="/WEB-INF/view/common/common.jsp" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <style>

        html{

            height: 100%;
        }
        body{
            height: 100%;
            margin: 0;
            overflow: hidden;
        }
        .con {
            /*position: fixed;*/
            /*top: 0;*/
            /*right: 0;*/
            /*left: 0;*/
            /*bottom: 0;*/
            padding: 0;
            overflow: hidden;
            min-height: 100%;
            background: url("${ctx}/resources/images/signbg.jpg") no-repeat;
            background-size: 100% 100%;
        }

        .log {
            width: 100%;
            height: 200px;
        }

        .log img {
            width: 100%;
            height: 100%;
        }

        .info {
            margin-top: 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 40px;
        }

        .info .avatar {
            width: 60px;
            height: 60px;
        }

        .avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
        }

        .right {
            color: white;
            font-size: 15px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: space-around;
        }

        .signbtn {
            margin: 20px auto 0;
            width: 120px;
            height: 120px;
        }

        .signbtn img {
            width: 100%;
            height: 100%;
        }

        .mark {
            color: white;
            font-size: 15px;
            text-align: center;
        }


    </style>
    <title>签到</title>
</head>
<body>
<div class="con">
    <div class="log">
        <img src="<c:url value="/resources/images/qd.png"/>">
    </div>

    <div class="info">
        <div class="avatar">
            <img class="avatar" src="${agent.headimgurl}" alt="">
        </div>

        <div class="right">
            <p>累计签到: ${signCount==null?0:signCount.allCount}天</p>
            <p>积分总数: ${agent.accounts.pointsBalance}积分</p>
        </div>

    </div>

    <div class="signbtn">
        <img src="<c:url value="/resources/images/signbt.png"/>" alt="">
    </div>

    <div class="mark">
        <p>
            每天签到领积分!用积分0元换购活动产品!
        </p>
        <p>
            <a href="<c:url value="/pmall/show.html"/>">立即购买</a>
        </p>
    </div>

</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script type="text/javascript">

    $(function () {

        $(".signbtn").click(function () {
            var url = "<c:url value='/mobile/sign.json'/>";
            let param = {}
            $.post(url, param, function (xhr) {
                if (xhr.flag == 0) {
                    alert("签到成功!奖励积分到账!")
                    window.location.reload()
                } else {
                    alert(xhr.message)
                }
            })
            // window.location.href = url;
        });


    })


</script>


</body>
</html>